package com.example.machine.enums;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 * Date: 2024-02-19
 * Time: 19:15
 */
public enum MachineStatusEnum {
    //赋予每个枚举值若干个属性
    DELETED(0,"删除"),
    NORMAL(1,"测试完成"),
    FORBIDDEN(2,"测试中");

    public static MachineStatusEnum getNameByCode(int code){
        switch(code){
            case 0: return MachineStatusEnum.DELETED;
            case 1: return MachineStatusEnum.NORMAL;
            default:
                return MachineStatusEnum.FORBIDDEN;
        }
    }
    private int code;
    private String name;

     MachineStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
